Symbol Style
These modifiers allow you to customize how SF Symbols are displayed and animated inside views, particularly with the Image component.
symbolRenderingMode
Sets the rendering mode for symbol images within the view.
Type
Options (SymbolRenderingMode)
"monochrome"– A single-color version using the foreground style"hierarchical"– Multiple layers with different opacities for depth (good for semantic coloring)"multicolor"– Uses the symbol's built-in colors"palette"– Allows layered tinting (like using multipleforegroundStylelayers)
Example
Explanation:
symbolRenderingMode="palette"tells the system to render the symbol in multiple layered styles.foregroundStylenow uses an object withprimary,secondary, and optionallytertiarylayers to color those symbol layers individually.
This matches SwiftUI's behavior with
.symbolRenderingMode(.palette)and.foregroundStyle(primary, secondary, tertiary).
symbolVariant
Displays the symbol with a particular visual variant.
Type
Options (SymbolVariants)
"none"– Default symbol with no variant"circle"– Encapsulated in a circle"square"– Encapsulated in a square"rectangle"– Encapsulated in a rectangle"fill"– Filled symbol"slash"– Adds a slash over the symbol (often used to indicate "off" states)
Example
symbolEffect
Applies a symbol animation effect to the view. This can include transitions (appear/disappear), scale, bounce, rotation, breathing, pulsing, and wiggle effects. You can also bind the effect to a value so it animates when the value changes.
Type
There are two forms of usage:
1. Simple effects (transition, scale, etc.)
You can directly assign a symbol effect name:
Examples
2. Value-bound discrete effects
These effects animate when the associated value changes.
Type
Example
In this example, each time isFavorited changes, the bounce animation is triggered.
Available Discrete Effects (DiscreteSymbolEffect)
These effects can be bound to values:
Full Example
This image uses:
- a hierarchical rendering mode
- a circular variant around the symbol
- a pulsing animation bound to
isNotifiedstate
